

# def search(nums,ss):
#     start = 0
#     end = len(nums) - 1
#     while start <= end:
#         mid = start + (end - start) // 2
#         # print("下标为",mid)
#         if nums[mid] == ss:
#             print("下标为", mid)
#             return
#         elif nums[mid] < ss:
#             start = mid + 1
#         else:
#             end = mid - 1
#     print(-1)
#
#
# search([1,2,3,5,6,7,9,13,15,19,20],9)



# 自动爬YY视频
# import requests
#
# def fire(page):
#     url = 'https://api-tinyvideo-web.yy.com/home/tinyvideosv2'
#     headers = {
#         'user-agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.105 Safari/537.36'}
#     for _ in range(page+1):
#         response = requests.get(url=url, headers=headers)
#         data = response.json()
#
#         data_list = data['data']['data']
#         print(data_list)
#
#         for d in data_list:
#             video_title = str(d['yyNum']) + '.mp4'
#             video_url = d['resurl']
#
#             video_content = requests.get(url=video_url, headers=headers).content
#
#             with open('video' + video_title, mode='wb') as f:
#                 f.write(video_content)
#                 print('保存完成:', video_title)
#
# if __name__ == '__main__':
#     fire(10)